package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author JIAN
 */
@RestController("agencyBankAccountController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 银行账号相关接口")
public class BankAccountController {
    @Resource
    private IBankAccountService bankAccountService;

    /**
     * 新增/修改银行账号
     */
    @PostMapping
    public void upsertBankAccount(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankAccountService.upsertBankAccount(bankAccountUpsertReqDTO);
    }

    /**
     * 获取当前用户的银行账户
     */
    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO getCurrentUserBankAccount() {
        return bankAccountService.getCurrentUserBankAccount();
    }
}